package com.coderman.infosys.auth.app.convert;

import com.coderman.infosys.auth.domain.bo.role.RoleBO;
import com.google.common.collect.Lists;

import java.util.List;
import java.util.stream.Collectors;

/**
 * Description:
 * date: 2022/1/22
 *
 * @author shenshuai
 * @version 1.0.0
 * @since JDK 1.8
 */
public interface BaseConvert {
    default List<RoleBO> buildFromListStr(List<String> roleCodeList){
        if(roleCodeList == null || roleCodeList.isEmpty()){
            return Lists.newArrayList();
        }
        return roleCodeList.stream().map(RoleBO::new).collect(Collectors.toList());
    }

}
